package org.example.listener;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

import java.util.LinkedList;
import java.util.List;

/**
 * 接收异步消息
 *
 * @author : Charles
 * @date : 2021/6/10
 */
@Slf4j
@Component
@RocketMQMessageListener(
        topic = "async_topic",
        consumerGroup = "async_group")
public class AsyncListener implements RocketMQListener<String> {
    @Override
    public void onMessage(String message) {

        log.info("{}收到消息：{}", this.getClass().getSimpleName(), message);
    }
}
